﻿@using HCMessage.Model
@{
    ViewBag.Title = "AddServer";
    var envEntity = (EnvEntity) Model;
}
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
//        $("#btn_submit").click(function() {
//            $.ajax({
//                type: "post",
//                url: '/Environment/UpdateServerInfo', 
//                data: $("#UpdateServerForm").serialize(),
//                error: function () { alert('Failed!'); },
//                success: function (data, textStatus) {
//                    alert("3");
//                }
//            });
//        });
    });

</script>
<form role="form" id="UpdateItemForm"  method="POST" action ='@Url.Action("UpdateServerInfo", "Environment")' enctype = "multipart/form-data" >
  <div class="form-group">
    <label for="ItemName">Name</label>
    <input class="form-control" id="ItemName" name="ItemName" placeholder="Enter service name">
  </div>
  <div class="form-group">
    <label for="ItemAddress">Address</label>
    <input class="form-control" id="ItemAddress" name="ItemAddress" placeholder="Address">
  </div>

    <div class="form-group">
        <label for="ItemEnvironment">Environment</label>
        <select id="ItemEnvironment" name="ItemEnvironment" class="form-control" style="width: 100px">
            @foreach (var r in  envEntity.EnvCtList)
            {
                 <option value="@r.EnvCode">@r.EnvName</option>
            }
        </select>
    </div>
      <div class="form-group">
    <label for="ItemInputFile">File input</label>
    <input type="file" id="ItemInputFile" name="ItemInputFile">
    <p class="help-block">You can upload excel to add service one time.</p>
  </div>
  <button type="submit" id="btn_submit" class="btn btn-primary">Submit</button>
</form>
